﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WarehouseWebAPP.code.BLL;

namespace WarehouseWebAPP.Pages.admin.New_Entities
{
    public partial class NewVendor : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
        {
            VendorBLL BLL = new VendorBLL();
            try
            {
                if (BLL.VendorGetByName(args.Value).Rows.Count > 0)
                    args.IsValid = false;
                else
                    args.IsValid = true;
            }
            finally
            {
                //TODO: Dispose
            }
        }
    }
}
